<template>
    <div>
        <detail :result="item" v-for="item of result" :key="item.id"></detail>
    </div>
</template>
<script>
import detail from '../components/detail'
    export default {
        components:{
            detail
        },
        data(){
            return {
                result:[]
            }
        },
        mounted(){
            var {id}=this.$route.query
            let url = `http://120.25.251.98:4000/playlist/detail?id=${id}`
            this.$http.get(url).then(res=>{
                var result = []
                result.push(res.data.playlist)
                result.forEach(item=>{
                    item['pic']=item.coverImgUrl;
                    item['title']=item.name;
                })
                this.result = result;
            })
        }
    }
</script>

<style scoped>

</style>